﻿#include "strucths.h"
#include <stdio.h>

void nhap(hs diem[],int cd) //hàm nhập danh sách từ file điểm cao

{
	if (cd==1) 
	{
		FILE *f = fopen(easy,"r");

		for(int i=0;i<5;i++)
			{
				fgets(diem[i].ten,50,f);
				fscanf(f,"\n%d\n",&diem[i].tg);
			}
	}
	else
		if (cd==2)
		{
			FILE *f = fopen(normal,"r");

			for(int i=0;i<5;i++)
			{
				fgets(diem[i].ten,50,f);
				fscanf(f,"\n%d\n",&diem[i].tg);
			}
		}
		else
		{
			FILE *f  = fopen(hard,"r");

			for(int i=0;i<5;i++)
			{
				fgets(diem[i].ten,50,f);
				fscanf(f,"\n%d\n",&diem[i].tg);
			}
		}
	
	
	fcloseall;
}